const san = require('/js-modules/common/san/san.js')
const Item = require('./items/item')

const Radio = san.defineComponent({
    template: `
        <div class="s-radio">
            <slot></slot>
        </div>
    `,
    messages: {
        'change': function (arg) {
            let val = arg.value
            this.data.set('model', val)
            this.fire('change', val)
        }
    }
})

Radio.Item = Item

module.exports = Radio

